]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Background: ignore cancellation errors
authorRay Strode <rstrode@redhat.com>
Wed, 20 Feb 2013 00:55:56 +0000 (01:55 +0100)
committerRay Strode <rstrode@redhat.com>
Wed, 20 Feb 2013 01:57:21 +0000 (20:57 -0500)
If the request cancellable is cancelled, the requesting background was
destroyed, so don't bother reporting the result.

https://bugzilla.gnome.org/show_bug.cgi?id=694227

js/ui/background.js

index 9ee6cb6ce31a63f6290f840e7dc681d962a1f5b0..4fda6f41e3bd9c98e5e1b19722ca12674a828185 100644 (file)
@@ -164,6 +164,9 @@ const BackgroundCache = new Lang.Class({
         if (candidateContent) {
             content = candidateContent.copy(params.monitorIndex, params.effects);
 
+            if (params.cancellable && params.cancellable.is_cancelled())
+                content = NULL;
+
             if (params.onFinished)
                 params.onFinished(content);
         } else {
@@ -264,7 +267,6 @@ const Background = new Lang.Class({
 
     _destroy: function() {
         this._cancellable.cancel();
-        this._cancellable = null;
 
         if (this._animationUpdateTimeoutId) {
             GLib.source_remove (this._animationUpdateTimeoutId);
@@ -458,7 +460,7 @@ const Background = new Lang.Class({
                                              onLoaded: Lang.bind(this, function(animation) {
                                                  this._animation = animation;
 
-                                                 if (!this._animation) {
+                                                 if (!this._animation || this._cancellable.is_cancelled()) {
                                                      this._setLoaded();
                                                      return;
                                                  }
@@ -477,8 +479,7 @@ const Background = new Lang.Class({
                                       cancellable: this._cancellable,
                                       onFinished: Lang.bind(this, function(content) {
                                           if (!content) {
-                                              if (this._cancellable &&
-                                                  !this._cancellable.is_cancelled())
+                                              if (!this._cancellable.is_cancelled())
                                                   this._loadAnimation(filename);
                                               return;
                                           }